<%
    var event=item;
    if (event) {
    if (event['Group']) {
%>
    <div area="<%= event['Area'] %>" class="event meetup item" group="<%= event['Group'] %>" event="<%= event['Meetup'] %>">
<% } else { %>
	<div area="<%= event['Area'] %>" class="event item ">
<%  }  %>
            <a target='_blank' href="<%= event['Url'] %>">
                <img class="thumbnail" style="min-height: 5em;max-height:7em;min-width: 8em; width: auto;" src="<%= event['Image'] || event['Portrait'] || (event['Group'] ? '/api/meetup?img=true&group='+event['Group']: undefined) || {Webinar:asset('img/events/neo4j_icon_webinar.png'),Training:asset('img/events/neo4j_icon_training.png'), Meetup: asset('img/events/neo4j_icon_meetup.png')}[event.Type] || asset('img/events/neo4j_icon_webinar.png') %>" title="<%= event['Title'] %>" alt="<%= event['Title'] %> logo"/>
            </a>
            <div class="caption">
                <h3 style="min-height:2.5em;vertical-align: top;" id="<%= item.key || key %>"><%- event['SourceTitle'] || event['Title'] %></h3>
                <% if (event['Date']) { %>
                <%=: event['Date'] | formatDateTime: event['Timezone'] %><br/>
				<hr/>
                <% } else if (event['Start']) { %>
                <%= event['Start'] %><br/>
				<hr/>
                <% } %>
                <% if (event['Location'] || event['City']) { %>
                <a href="http://maps.google.com/?q=<%= event['Location']|| event['City'] %>" target="_blank"><%= event['City'] || event['Location'] %></a><br/>
				<hr/>
                <% } %>
                <% if (event['Presenter']) { %>
                <% if (event['Twitter']) { %>
                <a target='_blank' href="http://twitter.com/<%= event['Twitter'] %>"> <h4><em>with <%= event['Presenter'] %></em></h4> </a>
                <% } else { %>
                <h4><em>with <%= event['Presenter'] %></em></h4>
                <% } %>
                <% } %>
            </div>
            <div class="introText">
                <% if ([event.Type] != "Training") { %>
                <p><%-: event['Description'] | truncate_words: 30 %></p>
                <% } %>
                <a class="link" style="left: 1em;" href="/api/event.ics?title=<%- encodeURIComponent(event['Title']) %>" target="_blank"><i class="icon-calendar"></i></a><br/>
                <a class="link" style="font-size: 1.5em" href="<%= event['Url'] %>" target="_blank"><%= event['Type']=="Training" ? "Sign me up" : "Participate"%> &raquo;</a><br/>
            </div>
        </div>
        <% }  %>